#ifndef __key_h   
#define __key_h
//HAL--------------------
	#define D_keyMoShi  P3_0	
	#define D_keyYuYue  P3_4	
	#define D_keyDingShi P1_0	
	#define D_keyKaiGuan  P1_3	
	//#define P_key5  P3_3	

        
//Const--------------------
  #define D_keyCount  4

#define F_keyMode()	P3MODL &=b1111_1100;P3MODH &=b1111_1100; P1MODL &=b0011_1100;\
					F_setG();F_setA();F_setB();F_setC();\
					P1MODH &=b1100_1111;   PINMOD &=b1111_0011; P3MODL &=b1111_0011;\
					P1MODH |=b0001_0000;   PINMOD |=b0000_0100; P3MODL |=b0000_0100;\
					F_setCom1();F_setCom2();F_setCom3();
 
//Var----------------------
 #ifdef __key_c
    uint8_t keyValue;
    uint8_t keyBuf[D_keyCount]={0xff,0xff,0xff,0xff};
    uint8_t keySta[D_keyCount]={1,1,1,1};
    uint8_t backUp[D_keyCount]={1,1,1,1};
	uint8_t longKeyJudgeTime;
	uint8_t longKeyValue;
	uint8_t holdKeyValue;
		uint8_t longKeyHoldTime;
		bit bAllowGetKey;
   
 #else
		extern bit bAllowGetKey;
		extern 	uint8_t longKeyHoldTime;
	 extern	uint8_t longKeyJudgeTime;
	extern uint8_t longKeyValue;
    extern  uint8_t keyValue;
    extern  uint8_t keyBuf[D_keyCount];
    extern  uint8_t keySta[D_keyCount];
    extern  uint8_t backUp[D_keyCount];
   
    
 
 #endif
   

//Function----------------------

void GetKey();
void KeyJudge();
#endif